import React from 'react'
import style from './style.module.scss'
import { BaseResultItem } from '../BaseResultItem'

export interface ProjectResultItemProps {
    readonly data: {
        id: string;
        img: string;
        title: string;
        teacher: string;
        describe: string;
    };
}

interface ProjectResultItemState {

}

const ProjectResultInfo: React.FC<ProjectResultItemProps> = (props: ProjectResultItemProps) => (
    <div className={style.itemInfo}>
        <h2>{props.data.title}</h2>
        <p className={style.teacher}>{props.data.teacher}</p>
        <section>
            <p>{props.data.describe}</p>
        </section>
    </div>
)

export class ProjectResultItem extends React.Component<ProjectResultItemProps, ProjectResultItemState> {
    render () {
        return (
            <BaseResultItem data={this.props.data}>
                <ProjectResultInfo data={this.props.data}/>
            </BaseResultItem>
        )
    }
}
